import { ApiProperty } from '@nestjs/swagger';
import { Exclude } from 'class-transformer';
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import * as dayjs from 'dayjs';

@Entity()
export class User {
  @ApiProperty({ description: 'id' })
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @ApiProperty({ description: '用户名' })
  @Column({ length: 500 })
  username: string;

  @ApiProperty({ description: '密码' })
  @Column({ length: 500 })
  password: string;

  @ApiProperty({ description: '邮箱' })
  @Column({ length: 500, default: '' })
  email: string | undefined;

  @ApiProperty({ description: '创建时间' })
  @Column('datetime', { default: dayjs().format() })
  createAt: string;

  @ApiProperty({ description: '更新时间' })
  @Column('datetime', { default: dayjs().format() })
  updateAt: string | undefined;

  @ApiProperty({ description: '删除时间' })
  @Column('datetime', { default: dayjs().format() })
  deleteAt: string | undefined;
}
